/* Author : Putri Andita R
 * 		    091511059
 * Proyek 4*/


package jtk.project4.fleet.field;

import java.awt.Dimension;

import jtk.project4.fleet.domain.Parts;

import nl.coderight.jazz.form.FormLayout;
import nl.coderight.jazz.form.FormLayout.Resize;
import nl.coderight.jazz.form.control.GroupControl;
import nl.coderight.jazz.form.field.SelectField;
import nl.coderight.jazz.form.field.TextField;


public class PartInventoryField extends GroupControl{
	private TextField reorderPointField;
	private TextField reorderQuantityField;
	private SelectField typeField;
	private TextField leadTimeField;
			
	
	public PartInventoryField(String bindID){
		setTitle("header.partinventoryinformation");
		setBindID(bindID);
		createFields();
		createLayout();
	}
	
	

	private void createFields() {
		// TODO Auto-generated method stub
		reorderPointField = new TextField("rPoint", 20);
//		reorderPointField.setRequired(true);
		
		reorderQuantityField = new TextField("rQty", 20);
	//	reorderQuantityField.setRequired(true);
		
		
		typeField = new SelectField<Parts>("domains","domain");
		typeField.setPreferredSize(new Dimension(165, 20));
	//	typeField.insert("FIFO", true);
		//typeField.insert("LIFO", true);
		
		
		
		leadTimeField = new TextField("leadTime", 20);
		//leadTimeField.setRequired(true);
	}
	
	
	
	private void createLayout() {
		// TODO Auto-generated method stub
		setLayout(new FormLayout())

		
		.addLabel("label.reorderPoint")		.addField(reorderPointField)
		.addLabel("label.type")				.addField(typeField)
		.addRow()
		.addLabel("label.reorderQuantity")	.addField(reorderQuantityField)
		.addLabel("label.leadtime")			.addField(leadTimeField)
		;	
	}	
}
